import request from '@/utils/request'


export function queryDepartment(realName) {
  return request({
    url: `/sealManagement/queryDepartment/${realName}`,
    method: 'get',
  })
}

export function submitForm(list) {
  console.log(list)
  return request({
    url: `/sealManagement/addDepartment`,
    method: 'Post',
    data:list
  })
}


// 解决ERROR ResizeObserver loop completed with undelivered notifications.
// 重写ResizeObserver的构造函数，并在其中定义并调用防抖函数
window.ResizeObserver = class ResizeObserver extends window.ResizeObserver {
  constructor(callback) {
    let timer = null;
    const debouncedCallback = function () {
      let context = this;
      let args = arguments;
      clearTimeout(timer);
      timer = setTimeout(function () {
        callback.apply(context, args);
      }, 16);
    };
    super(debouncedCallback);
  }
};
